<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * 薪资计算条件模板数据表
 *
 * Date: 2018/6/7
 * @author George
 */
class CreateTemplatesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('templates', function (Blueprint $table) {
            $table->increments('id');
			$table->unsignedInteger('company_id')->index()->comment('公司ID');
			$table->unsignedInteger('pattern_id')->index()->comment('方案ID');
			$table->string('name')->comment('模板名称');
			$table->string('type')->comment('规则类型');
			$table->decimal('ignore', 8, 2)->nullable()->comment('规则类型');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('templates');
    }
}
